package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("构造器初始化开始...");
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext("demo7");
        System.out.println("构造器初始化完毕");
        Person person = context.getBean(Person.class);
        person.play();

        //Spring容器可以关闭
        System.out.println("正在关闭Spring容器");
        context.close();
        System.out.println("Spring容器已关闭");
    }
}
